#ifndef ASYNC_H
#define ASYNC_H

#include <QThread>
#include <QObject>

class Async : public QThread
{
    Q_OBJECT

public:
    explicit Async(QObject *parent = nullptr);
    ~Async();

    Q_INVOKABLE void stop();

    Q_INVOKABLE void md5(const QString &fileName);
    Q_INVOKABLE void md5List(const QStringList &fileNames);

protected:
    void run() override;

signals:
    Q_INVOKABLE void result(QStringList values);
    Q_INVOKABLE void finished();

private:
    QString command;
    QStringList params;
};

#endif // ASYNC_H
